﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AdminDeskTop.aspx.cs" Inherits="LongSpeed.WebSite.Main.AdminDeskTop"
    ValidateRequest="false" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>久速科技网站后台管理系统</title>
    <script src="../../Scripts/admindesktop.js" type="text/javascript"></script>
    <script src="../../../Scripts/ueditor/editor_config.js" type="text/javascript"></script>
    <script src="../../../Scripts/ueditor/editor_all.js" type="text/javascript"></script>
    <link href="../../../Scripts/ueditor/themes/default/ueditor.css" rel="stylesheet"
        type="text/css" />
</head>
<body>
    <form runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" />
    <ext:Viewport runat="server" ID="vpDeskTop" Layout="BorderLayout">
        <Items>
            <ext:Panel runat="server" Region="North" Layout="FitLayout" Margins="5" BodyBorder="true"
                Collapsible="true" BaseCls="x-plain" ID="plTitle">
                <Content>
                    <p style="padding: 20px 20px 5px 20px; color: #556677; font-size: 25px;">
                        久速科技网站后台管理系统
                    </p>
                </Content>
            </ext:Panel>
            <ext:TreePanel ID="tree" runat="server" AutoScroll="true" Split="true" Region="West"
                Width="200" Collapsible="true" CollapseFirst="true" MinWidth="200" HideParent="False"
                RootVisible="False" BodyStyle="padding:10px;" Title="系统管理" Icon="Anchor">
                <Root>
                    <ext:TreeNode NodeID="0" Text="root" Cls="tree">
                        <Nodes>
                            <ext:TreeNode NodeID="1" Text="用户管理" Icon="User">
                                <Listeners>
                                    <Click Handler="TreeNode_Click(this);" />
                                </Listeners>
                            </ext:TreeNode>
                            <ext:TreeNode NodeID="2" Text="菜单管理" Icon="Server">
                                <Listeners>
                                    <Click Handler="TreeNode_Click(this);" />
                                </Listeners>
                            </ext:TreeNode>
                            <ext:TreeNode NodeID="3" Text="栏目管理" Icon="ScriptCodeRed">
                                <Listeners>
                                    <Click Handler="TreeNode_Click(this);" />
                                </Listeners>
                            </ext:TreeNode>
                            <ext:TreeNode NodeID="4" Text="站点配置" Icon="Cog">
                                <Listeners>
                                    <Click Handler="TreeNode_Click(this);" />
                                </Listeners>
                            </ext:TreeNode>
                        </Nodes>
                    </ext:TreeNode>
                </Root>
            </ext:TreePanel>
            <ext:TabPanel runat="server" Region="Center" ID="tpContent">
                <LoadMask Msg="正在加载……" />
                <Plugins>
                    <ext:TabScrollerMenu MaxText="15" PageSize="5" ID="ctl1322" />
                    <ext:TabCloseMenu runat="server" CloseAllTabsText="关闭所有标签" CloseOtherTabsText="关闭其他标签"
                        CloseTabText="关闭当前标签" />
                </Plugins>
                <Items>
                    <ext:GridPanel ID="MemuGridPanel" Hidden="true" runat="server" Height="500" Title="菜单管理"
                        Icon="Server">
                        <Store>
                            <ext:Store ID="MemuStore" runat="server" OnRefreshData="RefreshMemuData">
                                <Reader>
                                    <ext:JsonReader>
                                        <Fields>
                                            <ext:RecordField Name="ID" Type="Int" />
                                            <ext:RecordField Name="Name" Type="String" />
                                            <ext:RecordField Name="Description" Type="String" />
                                            <ext:RecordField Name="IsShow" Type="Boolean" />
                                            <ext:RecordField Name="Memo" Type="String" />
                                            <ext:RecordField Name="ParentId" Type="Auto" />
                                            <ext:RecordField Name="SortIndex" Type="Int" />
                                        </Fields>
                                    </ext:JsonReader>
                                </Reader>
                            </ext:Store>
                        </Store>
                        <ColumnModel ID="ColumnModel1" runat="server">
                            <Columns>
                                <ext:RowNumbererColumn />
                                <ext:Column Header="名称" DataIndex="Name" Width="200" />
                                <ext:Column Header="描述" DataIndex="Description" Width="300" Hidden="true" />
                                <ext:CheckColumn Header="是否显示" DataIndex="IsShow" Width="80" />
                                <ext:Column Header="排序索引" DataIndex="SortIndex" Width="80" />
                                <ext:Column Header="备注" DataIndex="Memo" Width="150" />
                                <ext:CommandColumn Width="200" Header="操作">
                                    <Commands>
                                        <ext:GridCommand Icon="ServerWrench" CommandName="ShowChild" Text="查看子层" />
                                        <ext:GridCommand Icon="NoteEdit" CommandName="Edit" Text="编辑" />
                                        <ext:GridCommand Icon="Delete" CommandName="Delete" Text="删除" />
                                    </Commands>
                                </ext:CommandColumn>
                            </Columns>
                        </ColumnModel>
                        <SelectionModel>
                            <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true"
                                Height="20">
                            </ext:RowSelectionModel>
                        </SelectionModel>
                        <LoadMask ShowMask="true" Msg="正在加载数据……" />
                        <TopBar>
                            <ext:Toolbar ID="Toolbar1" runat="server">
                                <Items>
                                    <ext:ToolbarFill ID="ToolbarFill1" runat="server" />
                                    <ext:Button ID="btnAdd" runat="server" Text="新建" Icon="Add">
                                        <Listeners>
                                            <Click Handler="NewData(EditMemuFrom,EditMemuWin,MemuGridPanel)" />
                                        </Listeners>
                                    </ext:Button>
                                </Items>
                            </ext:Toolbar>
                        </TopBar>
                        <BottomBar>
                            <ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="25">
                                <Items>
                                    <ext:ToolbarSpacer ID="ToolbarSpacer1" runat="server" Width="10" />
                                    <ext:Label ID="Label1" runat="server" Text="分页大小:" />
                                    <ext:ToolbarSpacer ID="ToolbarSpacer2" runat="server" Width="5" />
                                    <ext:ComboBox ID="ComboBox1" runat="server" Width="80">
                                        <Items>
                                            <ext:ListItem Text="10" />
                                            <ext:ListItem Text="15" />
                                            <ext:ListItem Text="25" />
                                        </Items>
                                        <SelectedItem Value="10" />
                                        <Listeners>
                                            <Select Handler="#{PagingToolbar1}.pageSize = parseInt(this.getValue()); #{PagingToolbar1}.doLoad();" />
                                        </Listeners>
                                    </ext:ComboBox>
                                </Items>
                            </ext:PagingToolbar>
                        </BottomBar>
                        <Listeners>
                            <Command Handler="GridPanelRowCommand(this,command, record,EditMemuFrom,EditMemuWin,vpDeskTop);" />
                        </Listeners>
                    </ext:GridPanel>
                    <ext:GridPanel ID="UserGridPanel" Hidden="true" runat="server" Height="500" Title="用户管理"
                        Icon="User">
                        <Store>
                            <ext:Store ID="UserStore" runat="server" OnRefreshData="RefreshUserData">
                                <Reader>
                                    <ext:JsonReader>
                                        <Fields>
                                            <ext:RecordField Name="ID" Type="Int" />
                                            <ext:RecordField Name="Name" Type="String" />
                                            <ext:RecordField Name="LoginName" Type="String" />
                                            <ext:RecordField Name="Memo" Type="String" />
                                            <ext:RecordField Name="Pwd" Type="String" />
                                            <ext:RecordField Name="ResponsibleItems" Type="String" />
                                            <ext:RecordField Name="Phone" Type="String" />
                                            <ext:RecordField Name="QQ" Type="String" />
                                            <ext:RecordField Name="SortIndex" Type="Int" />
                                            <ext:RecordField Name="UserIdentity" Type="String" />
                                        </Fields>
                                    </ext:JsonReader>
                                </Reader>
                            </ext:Store>
                        </Store>
                        <ColumnModel ID="UserColumnModel" runat="server">
                            <Columns>
                                <ext:RowNumbererColumn />
                                <ext:Column Header="名称" DataIndex="Name" Width="100" />
                                <ext:Column Header="登陆名" DataIndex="LoginName" Width="100" />
                                <ext:Column Header="初始密码" DataIndex="Pwd" Width="100" />
                                <ext:Column Header="负责项目" DataIndex="ResponsibleItems" Width="100" />
                                <ext:Column Header="电话" DataIndex="Phone" Width="100" />
                                <ext:Column Header="QQ" DataIndex="QQ" Width="100" />
                                <ext:Column Header="用户身份" DataIndex="UserIdentity" Width="100" />
                                <ext:Column Header="备注" Width="150" DataIndex="Memo" Hidden="true">
                                    <Renderer Fn="change" />
                                </ext:Column>
                                <ext:CommandColumn Width="150" Header="操作">
                                    <Commands>
                                        <ext:GridCommand Icon="NoteEdit" CommandName="Edit" Text="编辑" />
                                        <ext:GridCommand Icon="Delete" CommandName="Delete" Text="删除" />
                                    </Commands>
                                </ext:CommandColumn>
                            </Columns>
                        </ColumnModel>
                        <SelectionModel>
                            <ext:RowSelectionModel ID="RowSelectionModel2" runat="server">
                            </ext:RowSelectionModel>
                        </SelectionModel>
                        <LoadMask ShowMask="true" Msg="正在加载数据……" />
                        <TopBar>
                            <ext:Toolbar ID="Toolbar2" runat="server">
                                <Items>
                                    <ext:ToolbarFill ID="ToolbarFill2" runat="server" />
                                    <ext:Button ID="Button1" runat="server" Text="新建" Icon="Add">
                                        <Listeners>
                                            <Click Handler="NewData(UserFrom,EditUserWin,UserGridPanel)" />
                                        </Listeners>
                                    </ext:Button>
                                </Items>
                            </ext:Toolbar>
                        </TopBar>
                        <BottomBar>
                            <ext:PagingToolbar ID="UserPagingToolbar" runat="server" PageSize="15">
                                <Items>
                                    <ext:ToolbarSpacer ID="ToolbarSpacer3" runat="server" Width="10" />
                                    <ext:Label ID="Label2" runat="server" Text="分页大小:" />
                                    <ext:ToolbarSpacer ID="ToolbarSpacer4" runat="server" Width="5" />
                                    <ext:ComboBox ID="ComboBox2" runat="server" Width="80">
                                        <Items>
                                            <ext:ListItem Text="10" />
                                            <ext:ListItem Text="15" />
                                            <ext:ListItem Text="25" />
                                        </Items>
                                        <SelectedItem Value="10" />
                                        <Listeners>
                                            <Select Handler="#{UserPagingToolbar}.pageSize = parseInt(this.getValue()); #{UserPagingToolbar}.doLoad();" />
                                        </Listeners>
                                    </ext:ComboBox>
                                </Items>
                            </ext:PagingToolbar>
                        </BottomBar>
                        <Listeners>
                            <Command Handler="GridPanelRowCommand(this,command, record,UserFrom,EditUserWin,vpDeskTop);" />
                        </Listeners>
                    </ext:GridPanel>
                    <ext:GridPanel ID="PartGridPanel" Hidden="true" runat="server" Title="栏目管理" Icon="ScriptCodeRed">
                        <Store>
                            <ext:Store ID="StorePart" runat="server" OnRefreshData="RefreshPartData">
                                <Reader>
                                    <ext:JsonReader>
                                        <Fields>
                                            <ext:RecordField Name="ID" Type="Int" />
                                            <ext:RecordField Name="Name" Type="String" />
                                            <ext:RecordField Name="Memo" Type="String" />
                                            <ext:RecordField Name="SortIndex" Type="Int" />
                                            <ext:RecordField Name="IsSys" Type="Boolean" />
                                            <ext:RecordField Name="ViewType" Type="String" />
                                            <ext:RecordField Name="FromUrl" Type="String" />
                                            <ext:RecordField Name="UrlMappingId" Type="Int" />
                                        </Fields>
                                    </ext:JsonReader>
                                </Reader>
                            </ext:Store>
                        </Store>
                        <ColumnModel ID="ColumnModel2" runat="server">
                            <Columns>
                                <ext:RowNumbererColumn />
                                <ext:Column Header="名称" DataIndex="Name" Width="100" />
                                <ext:CheckColumn Header="显示到菜单" DataIndex="IsSys" Width="100" />
                                <ext:Column Header="排序索引" DataIndex="SortIndex" Width="100" />
                                <ext:Column Header="浏览类型" DataIndex="ViewType" Width="100" />
                                <ext:Column Header="Url路径" DataIndex="FromUrl" />
                                <ext:Column Header="备注" Width="150" DataIndex="Memo" Hidden="true" />
                                <ext:CommandColumn Width="150" Header="操作">
                                    <Commands>
                                        <ext:GridCommand Icon="Script" CommandName="ShowArticle" Text="文章" />
                                        <ext:GridCommand Icon="NoteEdit" CommandName="Edit" Text="编辑" />
                                        <ext:GridCommand Icon="Delete" CommandName="Delete" Text="删除" />
                                    </Commands>
                                </ext:CommandColumn>
                            </Columns>
                        </ColumnModel>
                        <SelectionModel>
                            <ext:RowSelectionModel ID="RowSelectionModel3" runat="server" />
                        </SelectionModel>
                        <LoadMask ShowMask="true" Msg="正在加载数据……" />
                        <TopBar>
                            <ext:Toolbar ID="Toolbar3" runat="server">
                                <Items>
                                    <ext:ToolbarFill ID="ToolbarFill3" runat="server" />
                                    <ext:Button ID="Button2" runat="server" Text="新建" Icon="Add">
                                        <Listeners>
                                            <Click Handler="NewData(EditPartFrom,EditPartWin,PartGridPanel)" />
                                        </Listeners>
                                    </ext:Button>
                                </Items>
                            </ext:Toolbar>
                        </TopBar>
                        <BottomBar>
                            <ext:PagingToolbar ID="PartPagingToolbar" runat="server" PageSize="15">
                                <Items>
                                    <ext:ToolbarSpacer ID="ToolbarSpacer5" runat="server" Width="10" />
                                    <ext:Label ID="Label3" runat="server" Text="分页大小:" />
                                    <ext:ToolbarSpacer ID="ToolbarSpacer6" runat="server" Width="5" />
                                    <ext:ComboBox ID="ComboBox3" runat="server" Width="80">
                                        <Items>
                                            <ext:ListItem Text="10" />
                                            <ext:ListItem Text="15" />
                                            <ext:ListItem Text="25" />
                                        </Items>
                                        <SelectedItem Value="10" />
                                        <Listeners>
                                            <Select Handler="#{PartPagingToolbar}.pageSize = parseInt(this.getValue()); #{PartPagingToolbar}.doLoad();" />
                                        </Listeners>
                                    </ext:ComboBox>
                                </Items>
                            </ext:PagingToolbar>
                        </BottomBar>
                        <Listeners>
                            <Command Handler="GridPanelRowCommand(this,command, record,EditPartFrom,EditPartWin,vpDeskTop);" />
                        </Listeners>
                    </ext:GridPanel>
                </Items>
            </ext:TabPanel>
            <ext:StatusBar ID="FormStatusBar" runat="server" Region="South">
                <Plugins>
                </Plugins>
                <Items>
                    <ext:Button runat="server" Text="注销" Icon="UserGo">
                        <DirectEvents>
                            <Click OnEvent="btnLoginOut_Click">
                            </Click>
                        </DirectEvents>
                    </ext:Button>
                </Items>
            </ext:StatusBar>
        </Items>
    </ext:Viewport>
    <ext:Window runat="server" ID="EditUserWin" Title="用户 - 编辑/详情" Icon="Pencil" Modal="true"
        Width="400" Hidden="true" Height="310">
        <Content>
            <ext:FormPanel ID="UserFrom" Frame="true" LabelAlign="Right" runat="server" Padding="10">
                <Items>
                    <ext:TextField AllowBlank="false" runat="server" FieldLabel="姓名" DataIndex="Name"
                        AnchorHorizontal="100%" />
                    <ext:TextField AllowBlank="false" runat="server" FieldLabel="登陆名" DataIndex="LoginName"
                        AnchorHorizontal="100%" />
                    <ext:TextField runat="server" FieldLabel="初始密码" DataIndex="Pwd" AnchorHorizontal="100%" />
                    <ext:TextField AllowBlank="false" runat="server" FieldLabel="负责项目" DataIndex="ResponsibleItems"
                        AnchorHorizontal="100%" />
                    <ext:TextField runat="server" FieldLabel="电话" DataIndex="Phone" AnchorHorizontal="100%" />
                    <ext:TextField AllowBlank="false" runat="server" FieldLabel="QQ" DataIndex="QQ" AnchorHorizontal="100%" />
                    <ext:ComboBox runat="server" DataIndex="UserIdentity" FieldLabel="用户身份" DefaultAnchor="管理员"
                        AllowBlank="false" Editable="false" Resizable="true" AnchorHorizontal="100%">
                        <Items>
                            <ext:ListItem Text="管理员" Value="管理员" />
                            <ext:ListItem Text="销售员" Value="销售员" />
                        </Items>
                    </ext:ComboBox>
                    <ext:TextField runat="server" FieldLabel="备注" DataIndex="Memo" AnchorHorizontal="100%" />
                </Items>
            </ext:FormPanel>
        </Content>
        <Buttons>
            <ext:Button ID="Button14" runat="server" Text="保存" Icon="Disk">
                <Listeners>
                    <Click Handler="#{UserFrom}.getForm().updateRecord(UserFrom.record); SaveData(1,UserFrom,false,EditUserWin,UserGridPanel) ;" />
                </Listeners>
            </ext:Button>
            <ext:Button ID="Button15" runat="server" Text="新建" Icon="UserAdd">
                <Listeners>
                    <Click Handler="SaveData(1,UserFrom,true,EditUserWin,UserGridPanel) ;#{UserGridPanel}.save();" />
                </Listeners>
            </ext:Button>
            <ext:Button ID="Button16" runat="server" Text="重置">
                <Listeners>
                    <Click Handler="#{UserFrom}.getForm().reset();" />
                </Listeners>
            </ext:Button>
        </Buttons>
    </ext:Window>
    <ext:Window runat="server" ID="EditMemuWin" Title="菜单 - 编辑/详情" Icon="Pencil" Modal="true"
        Width="800" Hidden="true" Height="570" Maximized="true" Draggable="false">
        <Content>
            <ext:FormPanel ID="EditMemuFrom" Frame="true" LabelAlign="Right" runat="server" Padding="10">
                <Items>
                    <ext:TextField LabelStyle="text-align:right" runat="server" DataIndex="ParentId"
                        Text="0" Hidden="true" />
                    <ext:TextField LabelStyle="text-align:right" runat="server" FieldLabel="名称" DataIndex="Name"
                        AnchorHorizontal="100%" />
                    <ext:TextField LabelStyle="text-align:right" runat="server" FieldLabel="排序索引" DataIndex="SortIndex"
                        DefaultAnchor="0" Regex="^[0-9]\d*$" AnchorHorizontal="100%" />
                    <ext:Checkbox LabelStyle="text-align:right" runat="server" FieldLabel="是否显示" DataIndex="IsShow" />
                    <ext:TextArea LabelStyle="text-align:right" runat="server" FieldLabel="描述" DataIndex="Description"
                        ID="editorMD" AutoScroll="true" AnchorHorizontal="100%" Height="465" />
                    <ext:TextField LabelStyle="text-align:right" runat="server" FieldLabel="备注" DataIndex="Memo"
                        AnchorHorizontal="100%" />
                </Items>
            </ext:FormPanel>
        </Content>
        <Buttons>
            <ext:Button ID="Button17" runat="server" Text="保存" Icon="Disk">
                <Listeners>
                    <Click Handler="#{EditMemuFrom}.getForm().updateRecord(EditMemuFrom.record); SaveData(2,EditMemuFrom,false,EditMemuWin,MemuGridPanel) ;" />
                </Listeners>
            </ext:Button>
            <ext:Button ID="Button18" runat="server" Text="新建" Icon="UserAdd">
                <Listeners>
                    <Click Handler="SaveData(2,EditMemuFrom,true,EditMemuWin,MemuGridPanel) ;" />
                </Listeners>
            </ext:Button>
            <ext:Button ID="Button19" runat="server" Text="重置">
                <Listeners>
                    <Click Handler="#{EditMemuFrom}.getForm().reset();" />
                </Listeners>
            </ext:Button>
        </Buttons>
    </ext:Window>
    <ext:Window runat="server" ID="EditPartWin" Title="栏目 - 编辑/详情" Icon="Pencil" Modal="true"
        Width="400" Hidden="true" Height="240">
        <Content>
            <ext:FormPanel ID="EditPartFrom" Frame="true" LabelAlign="Right" runat="server" Padding="10">
                <Items>
                    <ext:TextField runat="server" DataIndex="ID" Hidden="true" Text="0" />
                    <ext:TextField runat="server" FieldLabel="名称" DataIndex="Name" AnchorHorizontal="100%" />
                    <ext:TextField runat="server" DataIndex="SortIndex" Text="0" AllowBlank="true" Regex="^[0-9]\d*$" FieldLabel="排序索引" AnchorHorizontal="100%" BlankText="只允许输入正整数" />
                    <ext:TextField runat="server" FieldLabel="Url路径" DataIndex="FromUrl" AnchorHorizontal="100%" Regex="^[a-z0-9A-Z]+[_\-]?[a-z0-9A-Z]+.html$" BlankText="输入Url格式不正确" />
                    <ext:TextField runat="server" FieldLabel="Url映射ID" DataIndex="UrlMappingId" Hidden="true" />
                    <ext:Checkbox runat="server" DataIndex="IsSys" FieldLabel="是否显示到菜单" />
                    <ext:ComboBox runat="server" DataIndex="ViewType" FieldLabel="显示类型" AllowBlank="true"
                        Editable="false" Resizable="true" AnchorHorizontal="100%">
                        <Items>
                            <ext:ListItem Text="List" Value="List" />
                            <ext:ListItem Text="Info" Value="Info" />
                        </Items>
                    </ext:ComboBox>
                    <ext:TextField runat="server" FieldLabel="备注" DataIndex="Memo" AnchorHorizontal="100%" />
                </Items>
            </ext:FormPanel>
        </Content>
        <Buttons>
            <ext:Button ID="Button20" runat="server" Text="保存" Icon="Disk">
                <Listeners>
                    <Click Handler="#{EditPartFrom}.getForm().updateRecord(EditPartFrom.record); SaveData(5,EditPartFrom,false,EditPartWin,PartGridPanel) ;" />
                </Listeners>
            </ext:Button>
            <ext:Button ID="Button21" runat="server" Text="新建" Icon="UserAdd">
                <Listeners>
                    <Click Handler="SaveData(5,EditPartFrom,true,EditPartWin,PartGridPanel) ;" />
                </Listeners>
            </ext:Button>
            <ext:Button ID="Button22" runat="server" Text="重置">
                <Listeners>
                    <Click Handler="#{EditPartFrom}.getForm().reset();" />
                </Listeners>
            </ext:Button>
        </Buttons>
    </ext:Window>
    <script type="text/javascript">
        var desEditor;

        window.onload = function () {

            Ext.onReady(function () {
                var editor = baidu.editor.ui.Editor({
                    textare: "myValue"
                });
                editor.render("editorMD");
                desEditor = editor;
            });
        }
        //获得 editor.getContent()
        //赋值 editor.setContent("")

    </script>
    </form>
</body>
</html>
